package com.itcat.controller;/*
 * @Author: gonhsl
 * @Date:2022-04-04-16:29
 * */

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itcat.common.CommonPage;
import com.itcat.common.CommonResult;
import com.itcat.mysql.pojo.SmsCouponHistory;
import com.itcat.service.SmsCouponHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/couponHistory")
public class SmsCouponHistoryController {
    @Autowired
    private SmsCouponHistoryService smsCouponHistoryService;
    /**
     * Description:
     * date: 2022/4/4 16:30
     * @author: chp
     * @since JDK 1.8
     */
@GetMapping("list")
    public CommonResult list(Integer pageNum,Integer pageSize,
                             Integer couponId,String orderSn,
                             Integer useStatus){

    Page<SmsCouponHistory> page = smsCouponHistoryService.list(pageNum, pageSize, couponId, orderSn, useStatus);

    return CommonResult.success(CommonPage.restPage(page));
}
}
